﻿/********************************************************************
	created:	2011-8-17   14:33
	author:		Lifan Su
	
	purpose:	Interface of TIGER-192 functions
*********************************************************************/

#ifndef TIGER192_H
#define TIGER192_H

#include "crypt_hash_common.h"

#ifdef __cplusplus
extern "C" {
#endif

    //  data only
    struct TIGER192_d {
        uint64_t    hash[3];
    };

    //  stream with statue
    struct TIGER192_c {
        uint64_t    hash[3];

        uint8_t     buffer[64];

        uint64_t    length;
        uint8_t     append;
    };

    //  from big-endian, as hex print in hashcalc
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_d_read(struct TIGER192_d *, const void *);

    //  to big-endian, as hex print in hashcalc
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_d_write(void *, const struct TIGER192_d *);

    //  print, at least 49 char shall be provided
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_d_print(char *, const struct TIGER192_d *);
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_d_printw(wchar_t *, const struct TIGER192_d *);

    //  comp
    CRYPT_HASH_PREFIX uint8_t CRYPT_HASH_API tiger192_d_less(const struct TIGER192_d *, const struct TIGER192_d *);
    CRYPT_HASH_PREFIX uint8_t CRYPT_HASH_API tiger192_d_eq(const struct TIGER192_d *, const struct TIGER192_d *);

    //  convert
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_cvt(struct TIGER192_d *, const struct TIGER192_c *);

    //  init
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_c_init(struct TIGER192_c *);

    //  append
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_c_append(struct TIGER192_c *, const void *, uint64_t);

    //  close
    CRYPT_HASH_PREFIX void CRYPT_HASH_API tiger192_c_close(struct TIGER192_c *);

#ifdef __cplusplus
}
#endif


#endif // TIGER192_H